package com.zmzncs.lmtc.module.order.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zmzncs.lmtc.module.order.pojo.orderreserve.ParkReserveRecord;
import com.zmzncs.lmtc.module.order.pojo.orderreserve.ParkReserveRecordDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 预约记录表 Mapper 接口
 * </p>
 *
 * @author 任建波
 * @since 2020-12-14
 */
@Repository
@Mapper
public interface ParkReserveRecordDao extends BaseMapper<ParkReserveRecord> {

      /** 查询预约记录表分页数据 */
      IPage<ParkReserveRecordDTO> list(Page page, @Param("status") String status);
      /** 查询预约记录 */
      List<ParkReserveRecordDTO> list(@Param("status") Integer status);
      /** 根据id查询数据 */
      ParkReserveRecordDTO getById(Long id);
      /**查询所有预约记录信息 */
      IPage<ParkReserveRecordDTO> getAllReserveRecord(Page page, @Param("parkId")Long parkId,@Param("status") Integer status);

      /**查询申请中的预约信息 */
      IPage<ParkReserveRecordDTO> getSubmitReserveRecord(Page page, @Param("parkId")Long parkId);

      /** 查询停车场*天预约成功的预约记录*/
      List<ParkReserveRecordDTO>getReserveRecordByReserveDate(@Param("parkId") Long parkId,@Param("reserveDate") Date reserveDate);

      /**昨天、今天、本周、本月的预约缴费*/
      String getReserveAmountByDate(@Param("parkId") Long parkId, @Param("dateType") Integer dateType);

      /** 每月收益 */
      String getMonthIncome(@Param("parkId") Long parkId, @Param("month") Integer month);

}
